﻿using Shake.Business.Infrastructures;
using Shake.Framework.Contents;
using Shake.Framework.Dto;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;

namespace Shake.Business.Services
{
    public class CommonService : ICommonService
    {
        public List<MenuTemplate> GetMenuTemplates()
        {
            if (!File.Exists(PathConfiguration.MenuJsPath)) return new List<MenuTemplate>();

            var json = File.ReadAllText(PathConfiguration.MenuJsPath);

            return Newtonsoft.Json.JsonConvert.DeserializeObject<List<MenuTemplate>>(json);
        }
    }
}